// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.Mapping;

[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.AllFieldConverter))]
public sealed partial class AllField
{
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public AllField(string analyzer, bool enabled, bool omitNorms, string searchAnalyzer, string similarity, bool store, bool storeTermVectorOffsets, bool storeTermVectorPayloads, bool storeTermVectorPositions, bool storeTermVectors)
	{
		Analyzer = analyzer;
		Enabled = enabled;
		OmitNorms = omitNorms;
		SearchAnalyzer = searchAnalyzer;
		Similarity = similarity;
		Store = store;
		StoreTermVectorOffsets = storeTermVectorOffsets;
		StoreTermVectorPayloads = storeTermVectorPayloads;
		StoreTermVectorPositions = storeTermVectorPositions;
		StoreTermVectors = storeTermVectors;
	}
#if NET7_0_OR_GREATER
	public AllField()
	{
	}
#endif
#if !NET7_0_OR_GREATER
	[System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")]
	public AllField()
	{
	}
#endif
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	internal AllField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
	{
		_ = sentinel;
	}

	public
#if NET7_0_OR_GREATER
	required
#endif
	string Analyzer { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	bool Enabled { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	bool OmitNorms { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	string SearchAnalyzer { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	string Similarity { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	bool Store { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	bool StoreTermVectorOffsets { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	bool StoreTermVectorPayloads { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	bool StoreTermVectorPositions { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	bool StoreTermVectors { get; set; }
}

public readonly partial struct AllFieldDescriptor
{
	internal Elastic.Clients.Elasticsearch.Mapping.AllField Instance { get; init; }

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public AllFieldDescriptor(Elastic.Clients.Elasticsearch.Mapping.AllField instance)
	{
		Instance = instance;
	}

	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public AllFieldDescriptor()
	{
		Instance = new Elastic.Clients.Elasticsearch.Mapping.AllField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance);
	}

	public static explicit operator Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor(Elastic.Clients.Elasticsearch.Mapping.AllField instance) => new Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor(instance);
	public static implicit operator Elastic.Clients.Elasticsearch.Mapping.AllField(Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor descriptor) => descriptor.Instance;

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor Analyzer(string value)
	{
		Instance.Analyzer = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor Enabled(bool value = true)
	{
		Instance.Enabled = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor OmitNorms(bool value = true)
	{
		Instance.OmitNorms = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor SearchAnalyzer(string value)
	{
		Instance.SearchAnalyzer = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor Similarity(string value)
	{
		Instance.Similarity = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor Store(bool value = true)
	{
		Instance.Store = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor StoreTermVectorOffsets(bool value = true)
	{
		Instance.StoreTermVectorOffsets = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor StoreTermVectorPayloads(bool value = true)
	{
		Instance.StoreTermVectorPayloads = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor StoreTermVectorPositions(bool value = true)
	{
		Instance.StoreTermVectorPositions = value;
		return this;
	}

	public Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor StoreTermVectors(bool value = true)
	{
		Instance.StoreTermVectors = value;
		return this;
	}

	[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
	internal static Elastic.Clients.Elasticsearch.Mapping.AllField Build(System.Action<Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor> action)
	{
		var builder = new Elastic.Clients.Elasticsearch.Mapping.AllFieldDescriptor(new Elastic.Clients.Elasticsearch.Mapping.AllField(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance));
		action.Invoke(builder);
		return builder.Instance;
	}
}